<template>
    <a-modal v-model:open='open' title='Basic Modal' @ok='handleOk'>
        demo AddDialog
        <template #footer>
            <a-button key='back' @click='handleClose'>{{ t('关闭') }}</a-button>
            <a-button key='submit' class='saveButton' type='primary' :loading='loading'
                @click='handleOk'>{{ t('保存') }}</a-button>
        </template>
    </a-modal>
</template>
<script lang='ts' setup>
import { DefineProps, computed, defineEmits, ref } from 'vue';
import { useI18n } from 'vue-i18n';
const { t: t } = useI18n();
const emit = defineEmits(['ok', 'close', 'update:visible'])
const props = defineProps({
    visible: {
        type: Boolean,
        required: true,
        default: false
    },
})
const open = computed({
    get() {
        return props.visible
    },
    set(value) {
        emit('update:visible', value)
    }
})
const handleOk = () => {
    handleClose()
}
const handleClose = () => {
    emit('update:visible', false)
}
</script>
<style lang='scss' scoped>
</style>